<?php

class KeywordFilter extends CActiveRecordBehavior {

	public $attributes;
	
	public function beforeSave($event) {
		
		static $keywods = array(
			'ydq', 'njn',
		);
		
		$model = $this->owner;

		foreach($this->attributes as $attr) {
			$value = $model->{$attr};
			if(in_array($value, $keywods)) {
				$model->{$attr} = '*';
			}
		}
		
	}
	
}

?>